
import {getBaseCategoryList,getBanners,getFloors,getGoods} from "http"
export default {
    state:{
        categoryList:[],//三级分类相关数据
        banners:[],//轮播数据
        floors:[],//楼层数据

    },
    mutations:{
        getCategoryList(state,categoryList){
            state.categoryList  =  categoryList
        },
        getBanners(state,banners){
            state.banners=banners
        },
        getFloors(state,floors){
            state.floors=floors
        }
    },
    actions:{
       async getCategoryList({commit}){
           const {code,data} = await getBaseCategoryList()
           if(code === 200){
               commit("getCategoryList",data)
           }
        },
        async getBanners({commit}){
            const {code,data} = await getBanners()
            if(code === 200){
                commit("getBanners",data)
            }
        },
        async getFloors({commit}){
            const {code,data} = await getFloors()
            if(code === 200){
                commit("getFloors",data)
            }
        },
    }
}